﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using Hxsoft.AppV1.Module;

namespace Hxsoft.AppV1.Admin.ModuleManage.Controls
{
	public partial class ModifyModule : BaseUserControl
	{
		protected void Page_Load(object sender, EventArgs e)
		{
			this.DataBind();
		}


		/// <summary>
		/// 属性 ModuleName
		/// </summary>
		public string ModuleName
		{
			get
			{
				return Convert.ToString(CtrlModuleName.Text);
			}
			set
			{
				CtrlModuleName.Text = value.ToString();
			}
		}

		/// <summary>
		/// 属性 RefModuleID
		/// </summary>
		public int? RefModuleID
		{
			get
			{
				if (String.IsNullOrEmpty(CtrlRefModuleID.Text))
					return null;

				return Convert.ToInt32(CtrlRefModuleID.Text);
			}
			set
			{
				if (value == null)
					CtrlRefModuleID.Text = "";
				else
					CtrlRefModuleID.Text = value.ToString();
			}
		}

		/// <summary>
		/// 属性 Memo
		/// </summary>
		public string Memo
		{
			get
			{
				if (String.IsNullOrEmpty(CtrlMemo.Text))
					return null;

				return Convert.ToString(CtrlMemo.Text);
			}
			set
			{
				if (value == null)
					CtrlMemo.Text = "";
				else
					CtrlMemo.Text = value.ToString();
			}
		}

        public string Keyword
        {
            get
            {
                return CtrKeyword.Text;
            }
            set
            {
                CtrKeyword.Text = value;
            }
        }

        public string Describe
        {
            get
            {
                return CtrDescribe.Text;
            }
            set
            {
                CtrDescribe.Text = value;
            }
        }

		/// <summary>
		/// 控件的 ModuleInfo 实例。
		/// </summary>
		public Hxsoft.AppV1.Module.Module Info
		{
			get
			{
				Hxsoft.AppV1.Module.Module module = new Hxsoft.AppV1.Module.Module();

				module.ModuleName = ModuleName;
				module.RefModuleId = RefModuleID;
				module.Memo = Memo;
                module.Keyword = Keyword;
                module.Describe = Describe;

				return module;
			}
			set
			{
				if (value == null) return;

				ModuleName = value.ModuleName;
				RefModuleID = value.RefModuleId;
				Memo = value.Memo;
                Keyword = value.Keyword;
                Describe = value.Describe;
			}
		}
	}
}